package reflect;

import reflect.annotation.AutoRunClass;
import reflect.annotation.AutoRunMethod;

import java.lang.reflect.Method;

public class ReflectDemo12 {
    public static void main(String[] args) throws Exception {
        Class cls= Class.forName("reflect.Person");
        Method method=cls.getMethod("sayHello");
        if(method.isAnnotationPresent(AutoRunMethod.class)){
            AutoRunMethod a=method.getAnnotation(AutoRunMethod.class);
            int value = a.value();
            System.out.println(value);
        }

    }
}
